//
//  SetUpViewController.m
//  PersonnelWashCar
//
//  Created by 张越 on 16/4/21.
//  Copyright © 2016年 张越. All rights reserved.
//

#import "SetUpViewController.h"
#import "ChangeMobileController.h"
#import "ServiceViewController.h"
#import "LoginViewController.h"

@interface SetUpViewController ()
@property (strong, nonatomic) IBOutlet UIButton *quitButton;

@end

@implementation SetUpViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"设置";
    __weak typeof(self)weakSelf = self;
    [self addLeftButtonWithImage:[UIImage imageNamed:@"返回箭头"] actionBlock:^{
        [weakSelf.navigationController popViewControllerAnimated:YES];
    }];
    
    self.quitButton.layer.cornerRadius = 5.0f;
    self.quitButton.layer.masksToBounds = YES;
    
}

// 更改手机号码
- (IBAction)changePhoneNOBtn:(UIButton *)sender {
    ChangeMobileController *changeVC =[[ChangeMobileController alloc]init];
    [self.navigationController pushViewController:changeVC animated:YES];
    
}

// 服务说明
- (IBAction)serviceBtn:(UIButton *)sender {
    ServiceViewController *serviceVC = [[ServiceViewController alloc]init];
    [self.navigationController pushViewController:serviceVC animated:YES];
}

// 退出登录按钮
- (IBAction)quitButtonAction:(UIButton *)sender {
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultsUserIdKey];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultsUserPhotoUrl];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultsUserMobileNO];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultsUserNameKey];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultKey_Sex];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultArea];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultAddress];
    [[NSUserDefaults standardUserDefaults]removeObjectForKey:KUserDefaultAge];
    [[NSUserDefaults standardUserDefaults]synchronize];
    [SVProgressHUD showSuccessWithStatus:@"退出成功"];
    LoginViewController *loginVC = [[LoginViewController alloc]init];
    [self.navigationController pushViewController:loginVC animated:NO];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
